﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Work2
{
    class Program
    {
        static void Main(string[] args)
        {
            //1.常量
            const double PI = 3.14;
            double r = 3;
            double chang = 2 * PI * r;
            double area = PI * r * r;
            Console.WriteLine("圆的周长为："+chang);
            Console.WriteLine("圆的面积为：" + area);



            //2.命名规则
            string UserName = "王**";
            string userName = "Mr.wang";
            Console.WriteLine("你好，我叫"+UserName);
            Console.WriteLine("Or you can call me like this:"+userName);



            //3.If ...else...
            var set = 5 > 4;
            int num = 66;
            //一个分支
            if (set)
            {
                Console.WriteLine("结论正确");
            }
            //两个分支
            if (set)
            {
                Console.WriteLine("结论正确");
            }
            else
            {
                Console.WriteLine("结论错误");
            }

            //多个分支
            if (num>90)
            {
                Console.WriteLine("结果大于90");
            }
            else if (num>85)
            {
                Console.WriteLine("结果大于85");
            }
            else if (num > 66)
            {
                Console.WriteLine("结果大于66");
            }
            else
            {
                Console.WriteLine("没错没错");
            }



            //4.Swith case
            Console.WriteLine("请输入学生的考试成绩:");
            int points = int.Parse(Console.ReadLine());

            switch (points / 10)
            {
                case 10:
                case 9:
                    Console.WriteLine("这是高手");
                    break;
                case 8:
                    Console.WriteLine("不错呦");
                    break;
                case 7:
                case 6:
                    Console.WriteLine("可还行");
                    break;
                default:
                    Console.WriteLine("很遗憾，继续加油啊！");
                    break;
            }
            Console.ReadLine();

        }
    }
}
